#include <iostream>
#include <algorithm>

using namespace std;

//容器中嵌套容器，我们将所有数据进行遍历输出
void test() {
    vector<vector<int>> v;
    vector<int> v1;
    vector<int> v2;
    vector<int> v3;
    for (int i = 0; i < 3; ++i) {
        v1.push_back(i + i);
        v2.push_back(i * i);
        v3.push_back(i * i + i);
    }

    //将容器元素插入到vector v中
    v.push_back(v1);
    v.push_back(v2);
    v.push_back(v3);

    //通过大容器，把所有数据遍历一遍
    for (vector<vector<int>>::iterator it = v.begin(); it != v.end(); ++it) {
        for (vector<int>::iterator vit = (*it).begin(); vit != (*it).end(); ++vit) {
            cout << *vit << " ";
        }
        cout << endl;
    }
}

int main() {
    test();
    return 0;
}